* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

li, a {
  list-style: none;
  text-decoration: none;
  color: black;
}

$bgColor: #e0e0e0;
$bodyW: 80%;
$bg: 10px;
$width: 400px;
$height: 60px;

@mixin WH($height,$bg: 10px) {
  width: $bodyW;
  height: $height;
  margin: $bg auto;
}

header {

  @include WH(60px, 0);
  display: flex;

  & div {
    background-color: $bgColor;
    height: 100%;
  }

  .hLeft {
    width: $width;
    margin-right: $bg;
  }

  .hCenter {
    width: calc(100% - #{$width * 2 - $bg * 4});
    margin: 0 $bg;
  }

  .hRight {
    width: $width;
    margin-left: $bg;
  }
}

nav {
  @include WH(30px);
  background-color: $bgColor;
}

main {
  $barW: 250px;

  display: flex;
  @include WH(auto);

  // main左侧
  & .content {
    width: calc(100% - #{$barW - $bg * 4});
    margin-right: $bg;
    display: flex;

    & .cMain {
      width: calc((100% - #{$bg} * 2) / 2);
      $height: 200px;

      &:nth-child(1) {
        margin-right: $bg;
      }

      &:nth-child(2) {
        margin-left: $bg;
      }

      & .cMTop {
        background-color: $bgColor;
        margin-bottom: $bg;
        height: $height;
      }

      & .cMBottom {
        margin-top: $bg;
        height: $height;
        display: flex;

        & div {
          width: calc((100% - #{$bg * 2}) / 2);
          height: 100%;

          &:nth-child(1) {
            margin-right: $bg;
            background: $bgColor;
          }

          &:nth-child(2) {
            margin-left: $bg;
            background: $bgColor;
          }
        }

      }
    }
  }

  & .bar {
    width: $barW;

    & div {
      height: calc((100% - #{$bg * 4}) / 3);
      background-color: $bgColor;

      &:nth-child(2) {
        margin: $bg * 2 0;
      }
    }

  }
}

footer {
  @include WH(60px);
  background-color: $bgColor;
}

